package org.jeecg.common.system.api.factory;

import feign.hystrix.FallbackFactory;
import org.jeecg.common.system.api.ApiCenterFeign;
import org.jeecg.common.system.api.fallback.ApiCenterFeignFallback;
import org.springframework.stereotype.Component;

@Component
public class ApiCenterFeignFallbackFactory implements FallbackFactory<ApiCenterFeign> {

    @Override
    public ApiCenterFeign create(Throwable throwable) {
        ApiCenterFeignFallback fallback = new ApiCenterFeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
